/**
 *  场景管理 api
 *  @module api/site
 *  @author coder
 */

// API_HOST
import { API_HOST } from '@/config';

// axios
import axios from '@u/axios';

/**
 * 新增项目
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const addProject = (data) =>
	axios({
		method: 'post',
		data: data,
		url: API_HOST + '/project/add'
	});

/**
 * 更新项目
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const editProject = (data) =>
	axios({
		method: 'put',
		data: data,
		url: API_HOST + '/project/edit'
	});

/**
 * 删除项目
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const removeProject = (data) =>
	axios({
		method: 'delete',
		data: data,
		url: API_HOST + '/project/remove'
	});

/**
 * 获取项目分页列表
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const pageProject = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/project/page'
	});

/**
 * 获取项目不分页列表
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const listProject = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/project/list'
	});

/**
 * 获取项目单条信息详情
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const infoProject = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/project/info'
	});

/**
 * 项目字段去重
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const uniqueProject = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/project/unique'
	});
/**
 * 新增场景
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const addScene = (data) =>
	axios({
		method: 'post',
		data: data,
		url: API_HOST + '/scene/add'
	});

/**
 * 更新场景
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const editScene = (data) =>
	axios({
		method: 'put',
		data: data,
		url: API_HOST + '/scene/edit'
	});

/**
 * 删除场景
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const removeScene = (data) =>
	axios({
		method: 'delete',
		data: data,
		url: API_HOST + '/scene/remove'
	});

/**
 * 获取场景分页列表
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const pageScene = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/scene/page'
	});

/**
 * 获取场景不分页列表
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const listScene = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/scene/list'
	});

/**
 * 获取场景单条信息详情
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const infoScene = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/scene/info'
	});

/**
 * 场景字段去重
 * @param {object} [data] 发送键值对数据
 * @returns {promise}
 */
export const uniqueScene = (data) =>
	axios({
		method: 'get',
		data: data,
		url: API_HOST + '/scene/unique'
	});
